package com.ext.aic.beans;

import java.util.HashMap;

import io.github.eyinfo.messages.commons.models.IMessage;
import io.github.eyinfo.messages.commons.models.IUser;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class MessageItem implements IMessage {

    private Long id;

    private String message;

    private String timeString;

    private int type;

    private IMUser user;

    private String mediaFilePath;

    private long duration;

    private boolean send;

    private String progress;

    private MessageStatus mMsgStatus = MessageStatus.CREATED;

    @Override
    public String getMsgId() {
        return String.valueOf(this.id);
    }

    @Override
    public IUser getFromUser() {
        if (user == null) {
            return new IMUser();
        }
        return user;
    }

    @Override
    public String getTimeString() {
        return timeString;
    }

    @Override
    public int getType() {
        return this.type;
    }

    @Override
    public MessageStatus getMessageStatus() {
        return this.mMsgStatus;
    }

    @Override
    public String getText() {
        return this.message;
    }

    @Override
    public String getMediaFilePath() {
        return this.mediaFilePath;
    }

    @Override
    public long getDuration() {
        return this.duration;
    }

    @Override
    public String getProgress() {
        return this.progress;
    }

    @Override
    public HashMap<String, String> getExtras() {
        return null;
    }
}
